#include <Arduino.h>
#include "Button.h"
#include "Menu_Ctrl.h"
#include "Wifi_Ctrl.h"

void setup()
{
  // put your setup code here, to run once:
  Serial.begin(115200);
  delay(10);

  Button_Init();

  WiFi_Setup();
}

void loop()
{
  // put your main code here, to run repeatedly:

  uint8_t button_sta = get_button_state();
  if (button_sta != 0)
  {
    Serial.printf("ESP32 HEAP1 %d\r\n", esp_get_free_heap_size());
    Serial.printf("button %d\r\n", button_sta);
    //Serial.printf("button1 %d\r\n", menu_event);
  } 


  menu_proc(button_sta);

  WiFi_Loop();

  
}